/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
/*
 * appdata.h
 * Copyright (C) The Pennsylvania State University 2008 <tpk5010@psu.edu>
 */

/* appdata.h defines the struct _AppData, which provides handles to global
   application data, such as the HildonProgram, the HildonWindow, and the
   osso context. The AppUIData struct, defined in interface.h, containes a
   AppData element
*/

#ifndef APPDATA_H
#define APPDATA_H
#include <glade/glade.h>
#include <glib.h>
#include <gst/gst.h>
#include <curl/curl.h>

typedef struct _settings settings;
struct _settings {
	int DeviceID;
	gchar *Server;
	gchar *VideoSrc;
	gchar *VideoDevice;
	gchar *gpsdHost;
	int gpsdPort;
	gboolean useGPS;
};

typedef struct _gpsdata gpsdata;
struct _gpsdata {
	gdouble gpslat;
	gdouble gpslong;
	gint gpsTypeOfFix;
};

typedef struct _videoStream videoStream;
struct _videoStream {
    GstElement *pipeline;
	GstElementFactory *sourceFactory;
	GstElement *src;
	GstElementFactory *h264encFactory;
	GstElement *h264enc;
	GstCaps *caps;
	GstElementFactory *rtpPayloaderFactory;
	GstElement *rtpPayloader;
	GstElementFactory *udpsinkFactory;
	GstElement *udpsink;
	gint vport;
};

typedef struct _AppData AppData;
struct _AppData {
	CURL *curl;
    GladeXML *gxml;
   	gboolean connectedToServer;
   	videoStream *vstream;
   	GKeyFile *confFile;
    GKeyFileFlags keyFileFlags;
   	settings *config;
   	gboolean gpsHasFix;
   	gpsdata *gpsData;
};

#endif
